<template>
  	<input type="text" class="form-control" :placeholder="placetext" >
</template>
<script>
  export default {
    name:'datetimepicker',
    props:['placetext','value'],
    data(){
      return {}
    },
    watch:{
    	value:function(value){
	      $(this.$el).val(value)
    	}
    },
    mounted(){
    	let vm = this;
    	$( this.$el ).datetimepicker({
          format: 'yyyy-mm-dd',
          language:'zh-CN',
          autoclose: true,
          minView:'3',
          todayBtn:true
      }).on('changeDate',function(){
	    vm.$emit('input', this.value)
      })
    },
    destroyed: function () {
	    $(this.$el).datetimepicker('remove');
	}
  }
</script>
<style scoped lang="less">
  
</style>